<?php
ob_start();
ini_set('output_buffering','1'); 
require 'config/paths.php';
require 'config/sysconfig.php';
require 'libs/Bootstrap.php';
require 'libs/Controller.php';
require 'libs/Model.php';
require 'libs/View.php';
require 'libs/encryption.php';
require 'functions/sql.php';
require 'functions/functions.php';
require 'public/lang.php';
require 'functions/date.php';
require 'functions/menu.php';
require 'config/config.php';
$URL = $_SERVER['HTTP_REFERER'];
$URL = explode("?", @$URL);
$to=MAIL;
//$to="tejasrana95@gmail.com";
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$comment = $_REQUEST['phone'] ;
$dateTime = $_REQUEST['datetimepicker'] ;
$description = $_REQUEST['comment'] ;
$subject = "Message from: $name";
$from .= $email;



$headers = "From: ".$email." \r\n";
$headers .= "Reply-To: ".$email."\r\n";

//$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html\r\n"; 

$message.='<html><head></head><body><h2><b><u> Mail sent from callback</b></u></h2><br/>';
$message .='Name: '.$name."<br/><br/>";
$message .='Date: '.$dateTime."<br/><br/>";
$message .= 'Phone: '.$comment.'<br/><br/>';
$message .= 'Issue description: '.$description.'<br/><br/><br/><br/>';
$message .= 'Kind Regards <br/><br/>';
$message .= '-- <br/><br/>';
$message .= $name;
if (@mail($to, $subject, $message, $headers))
{
    // Transfer the value 'sent' to ajax function for showing success message.
    echo 'sent';
}
else
{
    // Transfer the value 'failed' to ajax function for showing error message.
    echo 'failed';
}
?>
 

